/*
 * Copyright (c) ycq_work@163.com
 */

package com.mxg.blog.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mxg.blog.common.CqLogger;
import com.mxg.blog.entity.User;
import com.mxg.blog.mapper.UserMapper;
import com.mxg.blog.service.UserService;
import org.springframework.stereotype.Service;

/**
 * @Author: ycq_work@163.com
 * @DATE: 2023/5/8 21:27
 * userserver接口实现
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {
    CqLogger logger = CqLogger.getInstance();

    private final UserMapper userMapper;

    public UserServiceImpl(UserMapper userMapper) {
        this.userMapper = userMapper;
    }

    @Override
    public User selectUserById(Integer id) {
        return userMapper.selectUserById(id);
    }

    @Override
    public User getUserByUserPhoneNum(String userPhoneNum){
        return userMapper.getUserByUserPhoneNum(userPhoneNum);
    }

    @Override
    public User getUserByUserEmail(String userEmail){
        return userMapper.getUserByUserEmail(userEmail);
    }

    @Override
    public void modifyPersonalInformation(Integer userId,
                                          String userName,
                                          String userEmail,
                                          String userPhone){
        userMapper.modifyPersonalInformation(userId, userName, userEmail, userPhone);
    }

    @Override
    public void modifyPersonalPassword(Integer userId, String userPassword){
        userMapper.modifyPersonalPassword(userId, userPassword);
    }

    @Override
    public void modifyPersonalAvatar(Integer userId, String userAvatar){
        userMapper.modifyPersonalAvatar(userId, userAvatar);
    }


}
